package com.bwhx.eruler.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.bwhx.eruler.bean.Feedback;
import com.bwhx.eruler.bean.Page;
import com.bwhx.eruler.dao.FeedbackDao;

@Repository
public class FeedbackDaoImpl extends BaseDaoImpl<Feedback> implements FeedbackDao{
	
	public FeedbackDaoImpl() {
		this.setNs("com.bwhx.eruler.mapper.FeedbackMapper.");
	}

	@Override
	public List<Feedback> list(Page p) {
		return getSqlSession().selectList(this.getNs() + "list",p);
	}

	@Override
	public Integer count(Feedback feedback) {
		Object selectOne = getSqlSession().selectOne(this.getNs() + "count",feedback);
		if(null!=selectOne && selectOne instanceof Integer){
			return (int)selectOne;
		}
		return 0;
	}

	@Override
	public void update(Feedback feedback) {
		getSqlSession().update(this.getNs() + "update",feedback);
		
	}

	@Override
	public void save(Feedback feedback) {
		getSqlSession().insert(this.getNs() + "insert",feedback);
		
	}

}
